<?php
define('BASE_PATH', dirname(__DIR__));
$siteid   = str_replace('.preview.dev.igoji.net', '', $_SERVER['HTTP_HOST']);
$siteRoot = BASE_PATH . '/_site/' . $siteid . '/public';
if ($_SERVER['REQUEST_URI'] == '/') {
    $path = $siteRoot . $_SERVER['REQUEST_URI'] . 'index.html';
} else {
    $path = $siteRoot . $_SERVER['REQUEST_URI'];
}
ob_start();
readfile($path);
$data = ob_get_contents();
ob_end_clean();
echo $data;
